Skip to content

Add canvas inspection report#24

Merged
sjquant merged 8 commits into
mainfrom
shannon-claimed-the-last-bagel-nzy
Jul 4, 2026
Merged

Add canvas inspection report#24
sjquant merged 8 commits into
mainfrom
shannon-claimed-the-last-bagel-nzy

Conversation

@sjquant

@sjquant sjquant commented Jul 2, 2026

Copy link
Copy Markdown
Owner

Why

Expose a deterministic canvas.inspect() report so agents can read measured layout state without rendering output or invoking diagnostics.

Changes

  • Add public inspection report models for canvas, layer, bbox, and text layout metadata.
  • Add canvas.inspect() backed by measure_layers(canvas), including layer IDs, order/z-order, visibility, bboxes, group children, and text wrapped lines/effective font sizes.
  • Build the inspection report inside Canvas so internal canvas state stays behind the class boundary.
  • Measure text layout metadata once in the measurement path and reuse it for inspection so wrapped text is not laid out again for the report.
  • Add black-box inspection tests for text, rich auto-scaled text, shapes, images, SVGs, groups, custom layers, invisible layers, and stable order/IDs.

Validation: uv run pytest tests/test_inspection.py tests/test_diagnostics.py; uv run ruff check quickthumb tests/test_inspection.py; touched-file formatter check passed.

@sjquant sjquant self-assigned this Jul 4, 2026
@sjquant sjquant merged commit e00eb13 into main Jul 4, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant